﻿<phone:PhoneApplicationPage 
    xmlns:local="clr-namespace:MidimediaFinder"
    local:TiltEffect.IsTiltEnabled="True"
    x:Class="MidimediaFinder.ItemPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768" 
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <!--Pivot Control-->
        <controls:Pivot Name="PivotControl" Title="{Binding Path=Strings.Title, Source={StaticResource LocalizedStrings }}">

            <controls:PivotItem Name="Pivot_Registry" Header="{Binding Path=Strings.Registry, Source={StaticResource LocalizedStrings }}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="500*" />

                    </Grid.RowDefinitions>
                    <ScrollViewer >

                        <StackPanel x:Name="StackPanel">

                            <Image Name="TypeImg" Source="/MidimediaFinder;component/Images/type.png" Width="60" Height="60" Margin="0,0,0,0" HorizontalAlignment="Left" />
                            <TextBlock Name ="TypeLabel" Text="{Binding Path=Strings.Type, Source={StaticResource LocalizedStrings }}" TextWrapping="NoWrap" Margin="70,-60,0,0" />
                            <TextBlock Name ="TypeArea" Text="a " TextWrapping="Wrap" Margin="70,-35,0,0" FontSize="30"/>
                            <TextBlock Text=" " TextWrapping="Wrap" FontSize="10"/>
                            
                            <Image Name="NameImg" Source="/MidimediaFinder;component/Images/name.png" Width="60" Height="60" Margin="0,0,0,0" HorizontalAlignment="Left" />
                            <TextBlock Name ="NameLabel" Text="{Binding Path=Strings.Name, Source={StaticResource LocalizedStrings }}" TextWrapping="NoWrap" Margin="70,-60,0,0" />
                            <TextBlock Name ="NameArea" Text=" " TextWrapping="Wrap" Margin="70,-35,0,0" FontSize="30"/>
                            <TextBlock Text=" " TextWrapping="Wrap" FontSize="10"/>

                            <Image Name="AddressImg" Source="/MidimediaFinder;component/Images/adress.png" Width="60" Height="60" Margin="0,0,0,0" HorizontalAlignment="Left" />
                            <TextBlock Name ="AddressLabel" Text="{Binding Path=Strings.Address, Source={StaticResource LocalizedStrings }}" TextWrapping="NoWrap" Margin="70,-60,0,0" />
                            <TextBlock Name ="AddressArea" Text=" " TextWrapping="Wrap" Margin="70,-35,0,0"/>
                            <TextBlock Text=" " TextWrapping="Wrap" FontSize="10"/>

                            <Image Name="PhoneImg" Source="/MidimediaFinder;component/Images/phone.png" Width="60" Height="60" Margin="0,0,0,0" HorizontalAlignment="Left" />
                            <TextBlock Name ="PhoneLabel" Text="{Binding Path=Strings.PhoneNumber, Source={StaticResource LocalizedStrings }}" TextWrapping="NoWrap" Margin="70,-60,0,0" />
                            <TextBlock Name ="PhoneArea" Text=" " TextWrapping="Wrap" Margin="70,-35,0,0"/>
                            <Button Name="PhoneButton" Content="{Binding Path=Strings.CallPhone, Source={StaticResource LocalizedStrings }}" Click="PhoneButton_Click"/>
                            <TextBlock Text=" " TextWrapping="Wrap" FontSize="10"/>

                            <Image Name="WebsiteImg" Source="/MidimediaFinder;component/Images/website.png" Width="60" Height="60" Margin="0,0,0,0" HorizontalAlignment="Left" />
                            <TextBlock Name ="WebsiteLabel" Text="{Binding Path=Strings.Website, Source={StaticResource LocalizedStrings }}" TextWrapping="NoWrap" Margin="70,-60,0,0" />
                            <TextBlock Name ="WebsiteArea" Text=" " TextWrapping="Wrap" Margin="70,-35,0,0"/>
                            <Button Name="WebsiteButton" Content="{Binding Path=Strings.OpenWebsite, Source={StaticResource LocalizedStrings }}" Click="WebsiteButton_Click"/>
                            <TextBlock Text=" " TextWrapping="Wrap" FontSize="10"/>


                            <Image Name="EmailImg" Source="/MidimediaFinder;component/Images/email.png" Width="60" Height="60" Margin="0,0,0,0" HorizontalAlignment="Left" />
                            <TextBlock Name ="EmailLabel" Text="{Binding Path=Strings.Email, Source={StaticResource LocalizedStrings }}" TextWrapping="NoWrap" Margin="70,-60,0,0" />
                            <TextBlock Name ="EmailArea" Text=" " TextWrapping="Wrap" Margin="70,-35,0,0"/>
                            <Button Name="EmailButton" Content="{Binding Path=Strings.ContactEmail, Source={StaticResource LocalizedStrings }}" Click="EmailButton_Click"/>
                            <TextBlock Text=" " TextWrapping="Wrap" FontSize="10"/>


                            <TextBlock Name ="DescriptionLabel" Text="{Binding Path=Strings.Description, Source={StaticResource LocalizedStrings }}" TextWrapping="NoWrap" FontSize="24"/>
                            <TextBlock Name ="DescriptionArea" Text="" TextWrapping="Wrap" Height="250" />

                            <TextBlock Text=" " TextWrapping="Wrap" FontSize="10"/>
                            <Image Name="FBImg" Source="/MidimediaFinder;component/Images/facebook.png" Width="60" Height="60" Margin="0,0,0,0" HorizontalAlignment="Left" />
                            <TextBlock Name ="FBLabel" Text="{Binding Path=Strings.Facebook, Source={StaticResource LocalizedStrings }}" TextWrapping="NoWrap" Margin="70,-60,0,0" />
                            <TextBlock Name ="FBArea" Text=" " TextWrapping="Wrap" Margin="70,-35,0,0"/>
                            <Button Name="FBButton" Content="{Binding Path=Strings.FacebookProfile, Source={StaticResource LocalizedStrings }}" Click="FBButton_Click"/>
                            <TextBlock Text=" " TextWrapping="Wrap" FontSize="10"/>

                            <Image Name="TwitterImg" Source="/MidimediaFinder;component/Images/twitter.png" Width="60" Height="60" Margin="0,0,0,0" HorizontalAlignment="Left" />
                            <TextBlock Name ="TwitterLabel" Text="{Binding Path=Strings.Twitter, Source={StaticResource LocalizedStrings }}" TextWrapping="NoWrap" Margin="70,-60,0,0" />
                            <TextBlock Name ="TwitterArea" Text=" " TextWrapping="Wrap" Margin="70,-35,0,0"/>
                            <Button Name="TwitterButton" Content="{Binding Path=Strings.TwitterChannel, Source={StaticResource LocalizedStrings }}" Click="TwitterButton_Click"/>
                            <TextBlock Text=" " TextWrapping="Wrap" FontSize="10"/>

                            <Image Name="MapImg" Source="/MidimediaFinder;component/Images/map.png" Width="60" Height="60" Margin="0,0,0,0" HorizontalAlignment="Left" />
                            <TextBlock Name ="MapLabel" Text="{Binding Path=Strings.MapAndDirections, Source={StaticResource LocalizedStrings }}" TextWrapping="NoWrap" Margin="70,-60,0,0" />
                            <TextBlock Name ="MapArea" Text=" " TextWrapping="Wrap" Margin="70,-35,0,0"/>
                            <Button Name="MapButton" Content="{Binding Path=Strings.OpenMap, Source={StaticResource LocalizedStrings }}" Click="MapButton_Click"/>
                            <TextBlock Text=" " TextWrapping="Wrap" FontSize="10"/>

                            <Image Name="ShareImg" Source="/MidimediaFinder;component/Images/share.png" Width="60" Height="60" Margin="0,0,0,0" HorizontalAlignment="Left" />
                            <TextBlock Name ="ShareLabel" Text="{Binding Path=Strings.Share, Source={StaticResource LocalizedStrings }}" TextWrapping="NoWrap" Margin="70,-60,0,0" />
                            <Button Name="ShareEMailButton" Content="{Binding Path=Strings.ShareEmail, Source={StaticResource LocalizedStrings }}" Click="ShareEMailButton_Click"/>
                            <Button Name="ShareSMsButton" Content="{Binding Path=Strings.ShareSMS, Source={StaticResource LocalizedStrings }}" Click="ShareSMsButton_Click"/>
                            <TextBlock Text=" " TextWrapping="Wrap" FontSize="10"/>


                            <Image Name="RegisteredOnImg" Source="/MidimediaFinder;component/Images/registeredon.png" Width="60" Height="60" Margin="0,0,0,0" HorizontalAlignment="Left" />
                            <TextBlock Name ="RegisteredOnLabel" Text="{Binding Path=Strings.RegisteredOn, Source={StaticResource LocalizedStrings }}" TextWrapping="NoWrap" Margin="70,-60,0,0" />
                            <TextBlock Name ="RegisteredOnArea" Text=" " TextWrapping="Wrap" Margin="70,-35,0,0"/>

                            <!--<Button Height="120" Name="Search_Button" Content="{Binding Path=Strings.Search, Source={StaticResource LocalizedStrings }}" Click="Search_Button_Click"/>
                            <TextBlock Height="30" HorizontalAlignment="Left" Text=" " FontSize="24" FontStretch="Expanded" FontWeight="Normal" TextAlignment="Left" Visibility="Visible" />
                            <TextBlock Height="30" HorizontalAlignment="Left" Name="Address_Label" Text="{Binding Path=Strings.Address, Source={StaticResource LocalizedStrings }}" FontSize="24" FontStretch="Expanded" FontWeight="Normal" TextAlignment="Left" Visibility="Collapsed" />
                            <TextBox Name="Address_Area" FontSize="30"  TextAlignment="Center" KeyDown="Address_Area_KeyDown" Visibility="Collapsed"/>
                            
                            <TextBlock Height="40" HorizontalAlignment="Left" Name="TypeChooser_Label" Text="{Binding Path=Strings.Type, Source={StaticResource LocalizedStrings }}" FontSize="24" FontStretch="Expanded" FontWeight="Normal" TextAlignment="Left" >

                            </TextBlock>

                            <Button Name="TypeChooser_Button" Content="{Binding Path=Strings.Type, Source={StaticResource LocalizedStrings }}" Click="TypeChooser_Click"/>
                            <TextBlock  Name="EmptyText" Text=" " FontSize="22" Height="50" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="Visible" TextAlignment="Center"/>

                            <Button Name="CancelUpdate_Button" Content="{Binding Path=Strings.Cancel, Source={StaticResource LocalizedStrings }}" Click="CancelUpdate_Button_Click" Visibility="Collapsed" />-->

                        </StackPanel>
                    </ScrollViewer>

                </Grid>
            </controls:PivotItem>
            <controls:PivotItem Name="Pivot_Images" Header="{Binding Path=Strings.Images, Source={StaticResource LocalizedStrings }}">
                <Grid>
                    <ScrollViewer Name="ScrollViewer_Image">

                        <StackPanel>
                            <Image Name="ImageUrl" />
                            
                        </StackPanel>
                    </ScrollViewer>
                    <ListBox x:Name="Images_List" Margin="0,0,-12,0" ItemsSource="{Binding Images}" SelectionMode="Single" Grid.Row="0" SelectionChanged="Images_List_SelectionChanged" Visibility="Collapsed">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Margin="0,0,0,17">
                                    <Image Source="{Binding _ImageUrl}" />
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Grid>
            </controls:PivotItem>
            <controls:PivotItem Name="Pivot_Comments" Header="{Binding Path=Strings.Comments, Source={StaticResource LocalizedStrings }}">
                <Grid Name="EditComment_Grid">
                    <Grid.RowDefinitions >
                        <RowDefinition Height="100" />
                        <RowDefinition Height="400*" />
                    </Grid.RowDefinitions>
                    <Button Name="EditComment_Button" Content="{Binding Path=Strings.SendComment, Source={StaticResource LocalizedStrings }}" Click="EditComment_Button_Click" Grid.Row="0"/>
                    <ListBox Grid.Row="1" x:Name="Comments_List" Margin="0,0,-12,0" ItemsSource="{Binding Comments}" SelectionMode="Single" SelectionChanged="Comments_List_SelectionChanged">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Margin="0,0,0,17">
                                    <Image Source="{Binding _Star1}" Width="25" Height="25" Margin="10,10,0,0" HorizontalAlignment="Left" />
                                    <Image Source="{Binding _Star2}" Width="25" Height="25" Margin="40,-25,0,0" HorizontalAlignment="Left" />
                                    <Image Source="{Binding _Star3}" Width="25" Height="25" Margin="70,-25,0,0" HorizontalAlignment="Left" />
                                    <Image Source="{Binding _Star4}" Width="25" Height="25" Margin="100,-25,0,0" HorizontalAlignment="Left" />
                                    <Image Source="{Binding _Star5}" Width="25" Height="25" Margin="130,-25,0,0" HorizontalAlignment="Left" />

                                    <TextBlock Text="{Binding _Username}" TextWrapping="NoWrap" Margin="160,-35,0,0" Style="{StaticResource PhoneTextLargeStyle}"/>
                                    <TextBlock Text="{Binding _Comment}" TextWrapping="Wrap" Margin="160,0,0,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                    <TextBlock Text="{Binding _Datetime}" TextWrapping="Wrap" Margin="160,0,0,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                    </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Grid>
            </controls:PivotItem>
            <controls:PivotItem Name="Pivot_Promotions" Header="{Binding Path=Strings.Promotions, Source={StaticResource LocalizedStrings }}">
                <Grid>
                    <ListBox x:Name="Promotions_List" Margin="0,0,-12,0" ItemsSource="{Binding SelectedPromotions}" SelectionMode="Single" Grid.Row="0" SelectionChanged="Promotions_List_SelectionChanged">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Margin="0,0,0,17">
                                    <Image Source="{Binding _ImageUrl}" Width="60" Height="60" Margin="60,0,0,0" HorizontalAlignment="Left" />
                                    <TextBlock Text="{Binding _Name}" TextWrapping="NoWrap" Margin="150,-70,0,0" Width="300" Style="{StaticResource PhoneTextLargeStyle}"/>
                                    <TextBlock Text="{Binding _Distance}" TextWrapping="Wrap" Margin="150,-25,0,0" Width="300" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                    <TextBlock Text="{Binding _Hint}" TextWrapping="Wrap" Margin="150,0,0,0" Width="300" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Grid>
            </controls:PivotItem>


        </controls:Pivot>
    </Grid>

</phone:PhoneApplicationPage>